package com.hfkh;

import java.util.Scanner;

/**
 * @Author MDD
 * @Description
 * @Version
 * @Date
 **/
public class No_7 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String username = "admin";
        int password = 123456;
        for (int i =2;i>0;i--){
            System.out.println("请输入用户名:");
            String name = sc.next();
            System.out.println("请输入密码：");
            int psd = sc.nextInt();
            if (name.equals(username) && psd==password){
                System.out.println("登录成功，欢迎进入二次元系统！");
                break;
            }
            else if (i!=1){
                System.out.println("用户名和密码错误,\n"+"你还有"+i+"次机会，请重新输入");
            }
            else {
                System.out.println("你没有权限计入系统！");
            }
        }
    }
}
